package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysInsuranceSchemeConfigMapper;
import com.ruoyi.system.domain.SysInsuranceSchemeConfig;
import com.ruoyi.system.service.ISysInsuranceSchemeConfigService;
import com.ruoyi.common.core.text.Convert;

/**
 * 保险方案配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-17
 */
@Service
public class SysInsuranceSchemeConfigServiceImpl implements ISysInsuranceSchemeConfigService 
{
    @Autowired
    private SysInsuranceSchemeConfigMapper sysInsuranceSchemeConfigMapper;

    /**
     * 查询保险方案配置
     * 
     * @param id 保险方案配置ID
     * @return 保险方案配置
     */
    @Override
    public SysInsuranceSchemeConfig selectSysInsuranceSchemeConfigById(Long id)
    {
        return sysInsuranceSchemeConfigMapper.selectSysInsuranceSchemeConfigById(id);
    }

    @Override
    public SysInsuranceSchemeConfig selectSysInsuranceSchemeConfigBySchemeName(String schemeName) {
        return sysInsuranceSchemeConfigMapper.selectSysInsuranceSchemeConfigBySchemeName(schemeName);
    }

    /**
     * 查询保险方案配置列表
     * 
     * @param sysInsuranceSchemeConfig 保险方案配置
     * @return 保险方案配置
     */
    @Override
    public List<SysInsuranceSchemeConfig> selectSysInsuranceSchemeConfigList(SysInsuranceSchemeConfig sysInsuranceSchemeConfig)
    {
        return sysInsuranceSchemeConfigMapper.selectSysInsuranceSchemeConfigList(sysInsuranceSchemeConfig);
    }

    /**
     * 新增保险方案配置
     * 
     * @param sysInsuranceSchemeConfig 保险方案配置
     * @return 结果
     */
    @Override
    public int insertSysInsuranceSchemeConfig(SysInsuranceSchemeConfig sysInsuranceSchemeConfig)
    {
        sysInsuranceSchemeConfig.setCreateTime(DateUtils.getNowDate());
        return sysInsuranceSchemeConfigMapper.insertSysInsuranceSchemeConfig(sysInsuranceSchemeConfig);
    }

    /**
     * 修改保险方案配置
     * 
     * @param sysInsuranceSchemeConfig 保险方案配置
     * @return 结果
     */
    @Override
    public int updateSysInsuranceSchemeConfig(SysInsuranceSchemeConfig sysInsuranceSchemeConfig)
    {
        sysInsuranceSchemeConfig.setUpdateTime(DateUtils.getNowDate());
        return sysInsuranceSchemeConfigMapper.updateSysInsuranceSchemeConfig(sysInsuranceSchemeConfig);
    }

    /**
     * 删除保险方案配置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysInsuranceSchemeConfigByIds(String ids)
    {
        return sysInsuranceSchemeConfigMapper.deleteSysInsuranceSchemeConfigByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除保险方案配置信息
     * 
     * @param id 保险方案配置ID
     * @return 结果
     */
    @Override
    public int deleteSysInsuranceSchemeConfigById(Long id)
    {
        return sysInsuranceSchemeConfigMapper.deleteSysInsuranceSchemeConfigById(id);
    }
}
